/*
 * @Author: 刘晓伟 1748805421@qq.com
 * @Date: 2024-04-16 11:36:57
 * @LastEditors: miteng 973203639@qq.com
 * @LastEditTime: 2024-07-05 16:58:17
 * @Description:
 * Copyright (c) 2024-present HBIS Digital Technology Co.,Ltd. All rights reserved.
 */
const iconOBj = ref({
    'el-icon-platform-eleme': 'ElemeFilled',
    'el-icon-delete-solid': 'DeleteFilled',
    'el-icon-user-solid': 'UserFilled',
    'el-icon-phone': 'PhoneFilled',
    'el-icon-phone-outline': 'Phone',
    'el-icon-more': 'MoreFilled',
    'el-icon-more-outline': 'More',
    'el-icon-star-on': 'StarFilled',
    'el-icon-star-off': 'Star',
    'el-icon-s-goods': 'GoodsFilled',
    'el-icon-warning': 'WarningFilled',
    'el-icon-warning-outline': 'Warning',
    'el-icon-s-check': 'Stamp',
    'el-icon-s-custom': 'Avatar',
    'el-icon-folder-checked': 'FolderChecked',
    'el-icon-question': 'QuestionFilled',
    'el-icon-info': 'InfoFilled',
    'el-icon-remove': 'RemoveFilled',
    'el-icon-circle-plus': 'CirclePlusFilled',
    'el-icon-success': 'SuccessFilled',
    'el-icon-error': 'CircleCloseFilled',
    'el-icon-zoom-in': 'ZoomIn',
    'el-icon-zoom-out': 'ZoomOut',
    'el-icon-remove-outline': 'Remove',
    'el-icon-circle-plus-outline': 'CirclePlus',
    'el-icon-circle-check': 'CircleCheck',
    'el-icon-circle-close': 'CircleClose',
    'el-icon-s-help': 'HelpFilled',
    'el-icon-help': 'Aim',
    'el-icon-picture-outline': 'Picture',
    'el-icon-picture': 'PictureFilled',
    'el-icon-picture-outline-round': 'PictureRounded',
    'el-icon-upload': 'UploadFilled',
    'el-icon-upload2': 'Upload',
    'el-icon-camera-solid': 'CameraFilled',
    'el-icon-video-camera-solid': 'VideoCameraFilled',
    'el-icon-video-camera': 'VideoCamera',
    'el-icon-message-solid': 'BellFilled',
    'el-icon-s-cooperation': 'Briefcase',
    'el-icon-s-order': 'List',
    'el-icon-s-unfold': 'Expand',
    'el-icon-s-home': 'HomeFilled',
    'el-icon-s-release': 'Failed',
    'el-icon-s-open': 'BrushFilled',
    'el-icon-s-marketing': 'TrendCharts',
    'el-icon-s-finance': 'WalletFilled',
    'el-icon-s-claim': 'Checked',
    'el-icon-s-data': 'Histogram',
    'el-icon-d-caret': 'DCaret',
    'el-icon-caret-left': 'CaretLeft',
    'el-icon-caret-right': 'CaretRight',
    'el-icon-caret-bottom': 'CaretBottom',
    'el-icon-caret-top': 'CaretTop',
    'el-icon-data-line': 'DataLine',
    'el-icon-data-board': 'DataBoard',
    'el-icon-data-analysis': 'DataAnalysis',
    'el-icon-location': 'LocationFilled',
    'el-icon-chat-line-round': 'ChatLineRound',
    'el-icon-bank-card': 'CreditCard',
    'el-icon-c-scale-to-original': 'ScaleToOriginal',
    'el-icon-chat-dot-round': 'ChatDotRound',
    'el-icon-s-platform': 'Platform',
    'el-icon-chat-line-square': 'ChatLineSquare',
    'el-icon-magic-stick': 'MagicStick',
    'el-icon-shopping-bag-2': 'Handbag',
    'el-icon-shopping-bag-1': 'ShoppingBag',
    'el-icon-shopping-cart-2': 'ShoppingCart',
    'el-icon-shopping-cart-1': 'ShoppingTrolley',
    'el-icon-suitcase-1': 'SuitcaseLine',
})
type IconKey = keyof typeof iconOBj.value;
export function dealIcon(icon: IconKey | string): string {
    let result: string = ''
    if (Object.keys(iconOBj.value).includes(icon)) {
        result = iconOBj.value[icon as IconKey]
    } else {
        const lastIndex = icon.lastIndexOf('-'); // 获取最后一个 '-' 的索引
        result = lastIndex !== -1 ? icon.substring(lastIndex + 1) : '';
        if (result === '1' || result === '2') {
            const lastSecondIndex = icon.lastIndexOf('-', lastIndex - 1)
            result = lastSecondIndex !== -1 ? icon.substring(lastSecondIndex + 1) : icon;
        }
    }
    return result
}